{extends file = 'include/base_with_menu.tpl'}

{block name='content'}
{foreach $catagory_dict as $catagory_id => $catagory_title}
<h3 class="blockTitle">{$catagory_title}</h3>
    {if $catagory_id|array_key_exists:$role_dict}
<div class="layout">
    <table width="90%" class="tbData01" cellspacing="0" cellpadding="0">
    {strip}
    {$catagory_roles=$role_dict[$catagory_id]}
    {$colum_num = 8}
    {foreach $catagory_roles as $role_info}
        {if $role_info@total == 1}
        <tr>
            <td width="12.5%">&nbsp;<a href="/perm/class_func/role/class_func_list?role_id={$role_info.id}">{$role_info.title}</a>&nbsp;</td>
            {for $col_index=1 to $colum_num - 1}
            <td width="12.5%">&nbsp;</td>
            {/for}
        </td>
        {elseif $role_info@first}
        <tr>
            <td width="12.5%">&nbsp;<a href="/perm/class_func/role/class_func_list?role_id={$role_info.id}">{$role_info.title}</a>&nbsp;</td>
        {elseif $role_info@last}
            <td width="12.5%">&nbsp;<a href="/perm/class_func/role/class_func_list?role_id={$role_info.id}">{$role_info.title}</a>&nbsp;</td>
            {$rest_col=$colum_num - $role_info@total % $colum_num}
            {for $col_index=1 to $rest_col}
            <td width="12.5%">&nbsp;</td>
            {/for}
        </tr>
        {elseif $role_info@index is div by $colum_num}
        </tr>
            <td width="12.5%">&nbsp;<a href="/perm/class_func/role/class_func_list?role_id={$role_info.id}">{$role_info.title}</a>&nbsp;</td>
        <tr>
        {else}
            <td width="12.5%">&nbsp;<a href="/perm/class_func/role/class_func_list?role_id={$role_info.id}">{$role_info.title}</a>&nbsp;</td>
        {/if}
    {/foreach}
    {/strip}
    </table>
</div>
    {/if}
{/foreach}
{/block}
